Location_();
var user_name = getCookie("user_name");
$('.user_name').text(user_name);
//点击头部按钮
function deleteCookie(name) {
	var date = new Date();
	date.setTime(date.getTime() - 10000);
	document.cookie = name + "=v; expires=" + date.toGMTString();
}

$('.header_son li').click(function() {
	deleteItem();
})
$('.header_son .index_header').click(function() {
	localStorage.setItem("Herf_id", '资源线索'); //放入session
})
$('.header_son .MyUser_header').click(function() {
	localStorage.setItem("Herf_id", '我的客户'); //放入session
})
$('.header_son .Service_header').click(function() {
	localStorage.setItem("Herf_id", '数据客服中心'); //放入session
})
$('.header_son .Oganization_header').click(function() {
	localStorage.setItem("Herf_id", '组织架构'); //放入session
})
$('.header_son .Resour_header').click(function() {
	localStorage.setItem("Herf_id", '部门管理'); //放入session
})
$('.header_son .Statistical_header').click(function() {
	localStorage.setItem("Herf_id", '统计管理'); //放入session
})

layui.use(['table', 'form', 'jquery', 'layer'], function() {
	var Herf_id = getCookie("Herf_id");
	var $ = layui.$ //重点处
		,
		layer = layui.layer;
	var form = layui.form;
	var table = layui.table;
	var hash = location.hash;
	if(sesstion_Herf_id == "资源线索") {
		$('.index_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5,
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['Cindex.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}
	if(sesstion_Herf_id == "我的客户") {
		$('.MyUser_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5, //动画实现
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['MyUser.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}
	if(sesstion_Herf_id == "数据客服中心") {
		$('.Service_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5,
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['Service_data.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}
	if(sesstion_Herf_id == "组织架构") {
		$('.Oganization_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5,
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['Oganization.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}
	if(sesstion_Herf_id == "部门管理") {
		$('.Resour_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5,
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['Resour_manage.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}
	if(sesstion_Herf_id == "统计管理") {
		$('.Statistical_header').addClass('layui-this');
		layer.open({
			type: 2,
			title: false,
			shade: 0,
			anim: 5,
			closeBtn: 0, //不显示关闭按钮
			area: ['100%', '100%'],
			content: ['Statistical.html', 'yes'], //iframe的url，no代表不显示滚动条
		});
	}

	active = {
		ziyuan_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['Cindex.html', 'no'], //iframe的url，no代表不显示滚动条
			});
		},
		kehu_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['MyUser.html', 'yes'], //iframe的url，no代表不显示滚动条
			});
		},
		shuju_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['Service_data.html', 'yes'], //iframe的url，no代表不显示滚动条
			});
		},
		zuzhi_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['Oganization.html', 'yes'], //iframe的url，no代表不显示滚动条
			});
		},
		tongji_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['Statistical.html', 'yes'], //iframe的url，no代表不显示滚动条
			});
		},
		bumen_type: function() {
			//iframe窗
			layer.open({
				type: 2,
				title: false,
				shade: 0,
				anim: 5,
				closeBtn: 0, //不显示关闭按钮
				area: ['100%', '100%'],
				content: ['Resour_manage.html', 'yes'], //iframe的url，no代表不显示滚动条
			});
		},
	};
	$('.layui-bg-cyan li').on('click', function() {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});

})